const Mock = require("mockjs")
function ranlist() {
    return  Mock.mock({
        "list|20":[
             {
                 "tit":"@ctitle",
                 "img":"@Image(200X200,@color)",
                 "word":"@cword(20,50)"
             }
        ]
    }).list
}
function addlist() {
    return  Mock.mock({
        "list|5":[
             {
                 "tit":"@ctitle",
                 "img":"@Image(200X200,@color)",
                 "word":"@cword(20,50)"
             }
        ]
    }).list
}

module.exports = {
    runtimeCompiler: true,// 支持解析动态创建组件
    devServer:{
        before(app){
            app.get("/list",(req,res)=>{
                res.send(ranlist())
            })
            app.get("/addList",(req,res)=>{
                res.send(addlist())
            })
        }
    }
}